import os
import string
import tempfile
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response, get_object_or_404
from django.template.context import RequestContext
from webmapper.models import Route, Area, Photo, PointOfInterest
from django.db.models.fields.related import ManyToManyRel
from django.core.urlresolvers import reverse

def getPhotosKml(request, id):
    kml = (
        '<?xml version="1.0" encoding="UTF-8"?>\n'
        '<kml xmlns="http://www.opengis.net/kml/2.2">\n'
        'TODO TODO TODO'
        '</kml>\n'
        )
    return HttpResponse(kml, 'application/vnd.google-earth.kml+xml')

def photoPage(request, id):
    photo = get_object_or_404(Photo, pk=id)
    return render_to_response('webmapper/photos/slideshowpage.html', {'photo': photo}, context_instance=RequestContext(request))

def photoPageTitle(request, id):
    photo = get_object_or_404(Photo, pk=id)
    return render_to_response('webmapper/photos/photopagetitle.html', {'photo': photo}, context_instance=RequestContext(request))

